<?php
/**
 * Created by Commend.
 * User: Vito
 */

namespace app\validate;

class SystemConfigTabValidate extends BaseValidate
{
    /**
     * 验证规则
     * 可设置语言包字段 语言包分组为valid_field
     * 例如 name|valid_field.name 或 name|name_alias 或 name
     * @var array
     */
    protected $rule = [
        'name'                      => 'require|max:50',
        'key|system_config_tab_key' => 'require|alphaDash|unique:system_config_tab',
        'pid'                       => 'require|checkHasCanEmpty:system_config_tab',
        'status'                    => 'require|checkEnum',
        'icon'                      => 'max:30',
        'sort'                      => 'number|between:0,255',
    ];

    /**
     * 字段对应的名称
     * 可设置语言包字段 语言包分组为valid_field
     * 例如 name => valid_field.name 或 name => name_alias
     * @var array
     */
    protected $field = [

    ];

    /**
     * 验证消息
     * 可设置语言包字段 无分组
     * @var array
     */
    protected $message = [

    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        self::SAVE_SCENE   => 'all',
        self::UPDATE_SCENE => 'all',
        self::LIST_SCENE   => ['pid', 'status',],
    ];
}
